<?php
// 用户本领的作品排序界面

// 标题栏
$tittleText = '修改作品排序';
require("$CfgPara->root/view/tittle_back_bar_blue.app.v.php");
?>
<script src="/tools/Sortable/Sortable.min.js"></script>
<div id="user_field_work_list" style="touch-action: none" data-id="<?= $InputData['user_field_id'] ?>">
    <?php
    if (isset ($workList) && count($workList) > 0) {
        foreach ($workList as $workMsg) {
            ?>
            <div data-id="<?= $workMsg->Id ?>" class="draggable-item app-border-right app-border-bottom"
                 style="width: 33.3333%; padding: 20px 10px; float: left; background-color: white">
                <img src="<?= $workMsg->Picture ?>" style="width: 100%; height: auto">
            </div>
        <?php }
    } ?>
</div>
<?php
// 底部按钮
require("$CfgPara->root/view/user_field_order_bottom_bar.app.v.php");
?>
<script>
    var list = document.getElementById("user_field_work_list");
    sort = Sortable.create(list, {
        draggable: '.draggable-item',
        onUpdate: user_field_order_en
    });
</script>
